﻿/*
**  引擎
*/
Object.extend(Eg, {
  ready: false,
  resources: [],
  init: function (opts) {
    Eg.sys = new Eg.Sys(opts);
    Eg.input = new Eg.Input();
    Eg.soundManager = new Eg.SoundManager();
    Eg.music = new Eg.Music();
    Eg.loader = new Eg.Loader(opts);
    Eg.font = new Eg.Font(opts.font);
    Eg.loader.addRes(Eg.font);

    Eg.ready = true;
    Eg.loader.load();
  },

  addResource: function (resource) {
    Eg.resources.push(resource);
  },


  setNocache: function (set) {
    Eg.nocache = set ? '?' + Date.now() : '';
  },


  // Stubs for Eg.Debug
  log: function () { },
  show: function (name, number) { },
  mark: function (msg, color) { }
});